import 'package:financing_wallet/mine/contentType.dart';
import 'package:get/get.dart';
import 'package:wallet_utils/report_widget/base/callback/base_callback.dart';
import 'package:wallet_utils/toast.dart';

import '../api/mine_api.dart';
import '../bean/aboutUsBean.dart';
import 'state.dart';

class AboutUsLogic extends GetxController {
  final AboutUsState state = AboutUsState();

  @override
  void onInit() {
    super.onInit();
    getUserInfo();
  }
  ///关于我们
  getUserInfo() {
    MineApi.getHTML(ContentType.about, BaseCallback(onSuccess: (map) {
      AboutUsBean aboutUsBean=AboutUsBean.fromJson(map);
      if(aboutUsBean.data!=null){
       state.name=aboutUsBean.data?.name;
       state.content=aboutUsBean.data?.content;
       update();
      }
    }, onError: (msg) {
      Future.delayed(const Duration(milliseconds: 500), () {
        ToastUtils.showToast(msg ?? "");

      });
    }));
  }
}
